@extends('layouts.default')
@section('content')
    <div class="row row-margin-top">
        <div class="col-xs-12">
            <a href="{{route('permissions.create')}}" class="btn btn-info btn-search">添加</a>

            <a href="{{route('permissions.batchcreate')}}" class="btn btn-info btn-search">批量添加</a>
        </div>
    </div>

    <div class="row row-margin-top">
        <div class="col-xs-12">
            <div class="table-responsive">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>排序</th>
                        <th>菜单</th>
                        <th>图标</th>
                        <th>显示状态</th>
                        <th>路由</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($permissionstree as $permissions)
                        <tr>
                            <td>{{ $permissions->sort }}</td>
                            <td>{{ $permissions->display_name }}</td>
                            <td><i class="fa {{ $permissions->icon }}"></i></td>
                            <td>
                                @if($permissions->is_show)
                                    显示
                                @else
                                    不显示
                                @endif
                            </td>
                            <td>{{ $permissions->name }}</td>
                            <td>{{ $permissions->description }}</td>
                            <td>
                                <a class="pull-left" href="{{route('permissions.edit',['id'=>$permissions->id])}}">
                                    <button type="button" class="btn btn-warning">修改</button>
                                </a>
                                <a class="pull-left" style="padding-left: 10px;">
                                    <form action="{{ route('permissions.destroy', $permissions->id) }}" method="post">
                                        {{ csrf_field() }}
                                        {{ method_field('DELETE') }}
                                        <button type="submit" class="btn  btn-danger">删除</button>
                                    </form>
                                </a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
@stop